﻿@model S4Store.Models.Report.SaleTimeRateModel
@{
    Layout = null;
    ViewBag.Title = "SaleTimeRate";
    var container = "div" + Guid.NewGuid().ToString();
}
<div style="height:100%;" class="verticalSplitContainer">

@Html.Action("ReportBar", "Common", Model.BarModel)
<div style="position:relative; width:100%; overflow:auto"  ratio="*">
    @{

        S4Store.Models.Chart.Column ChartModel = new S4Store.Models.Chart.Column();
        //ChartModel.Name = "登记客户";
        ChartModel.YAxis = "销售时间进度差概况";
        //ChartModel.Width = 500;
        //ChartModel.Height = 300;
        ChartModel.XAxis.Add("销售进度");
        ChartModel.XAxis.Add("订单进度");

        S4Store.Models.Chart.ChartSeries series1 = new S4Store.Models.Chart.ChartSeries();
        series1.Name = "销售实绩";
        series1.Data.Add(Model.SaleRate);
        series1.Data.Add(Model.OrderRate);
        ChartModel.Serieses.Add(series1);


        S4Store.Models.Chart.ChartSeries series2 = new S4Store.Models.Chart.ChartSeries();
        series2.Name = "时间进度";
        series2.Data.Add(Model.DateRate);
        series2.Data.Add(Model.DateRate);
        ChartModel.Serieses.Add(series2);
        }
        @Html.Partial("../Chart/Column", ChartModel)
        <div style=" margin-left:70px; overflow:hidden">
        <table style="width:100%">
            <tr>
                <td align="center" width="30">
                @if (Model.SaleCount < Model.TargetSaleCount)
                {
                    <a class="specialRed" href="@Url.Action("CarBrandTimeRate", new { Month = Model.BarModel.Month.ToString("yyyy-MM-dd") })" target="navtab" tip="分车型销量时间进度差" title="实际销量与应时销量的差值,红色说明销量未能达标">
                        <div class="value">@(Model.SaleCount - Model.TargetSaleCount)</div>
                        <div class="rt">实时销量：@Model.SaleCount</div>
                        <div class="rb">应时销量：@Model.TargetSaleCount</div>
                    </a>
                }
                else
                {
                    <a class="specialGreen" href="@Url.Action("CarBrandTimeRate", new { Month = Model.BarModel.Month.ToString("yyyy-MM-dd") })" target="navtab" tip="分车型销量时间进度差" title="实际销量与应时销量的差值,红色说明销量未能达标">
                        <div class="value">@(Model.SaleCount - Model.TargetSaleCount)</div>
                        <div class="rt">实时销量：@Model.SaleCount</div>
                        <div class="rb">应时销量：@Model.TargetSaleCount</div>
                    </a>
                }

                </td>
                <td align="center" width="30">
                @if (Model.OrderCount < Model.TargetOrderCount)
                {
                    <a class="specialRed"  href="@Url.Action("CarBrandOrderTimeRate", new { Month = Model.BarModel.Month.ToString("yyyy-MM-dd") })" target="navtab" tip="分车型订单时间进度差" title="实际订单与应时订单的差值，红色说明订单数量未能达标">
                        <div class="value">@(Model.OrderCount - Model.TargetOrderCount)</div>
                        <div class="rt">实际订单：@Model.OrderCount</div>
                        <div class="rb">应时订单：@Model.TargetOrderCount</div>
                    </a>
                }
                else
                {
                    <a class="specialGreen"  href="@Url.Action("CarBrandOrderTimeRate", new { Month = Model.BarModel.Month.ToString("yyyy-MM-dd") })" target="navtab" tip="分车型订单时间进度差" title="实际订单与应时订单的差值，红色说明订单数量未能达标">
                        <div class="value">@(Model.OrderCount - Model.TargetOrderCount)</div>
                        <div class="rt">实际订单：@Model.OrderCount</div>
                        <div class="rb">应时订单：@Model.TargetOrderCount</div>
                    </a>
                }
                </td>
            </tr>
        </table>
        </div>
        
    @*}
    else
    {
        <text>还未完成月初配置</text>
    }*@
</div>
</div>

